Cancelled
Push — release/2.1.0 ( 9888ea )
by Kevin Van
09:55 queued 09:52
created

Card.render   A

Complexity

Conditions 1

Size

Total Lines 18
Code Lines 16

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 16
dl 0
loc 18
rs 9.6
c 0
b 0
f 0
1
import React, { FunctionComponent } from "react"
2
import classNames from "classnames"
3
4
import Icon from "./Icon"
5
6
import "./Card.scss"
7
8
const Card: FunctionComponent<CardProps> = ({ className, hasTable, title, titleIcon, children }) => (
9
  <article
10
    className={classNames(`card`, className, {
11
      "card--has-table": hasTable,
12
    })}
13
  >
14
    <header className={`card__header`}>
15
      <h4>
16
        {titleIcon !== `` && <Icon icon={titleIcon} />} {title}
17
      </h4>
18
    </header>
19
    <div className={`card__content`}>{children}</div>
20
  </article>
21
)
22
23
Card.defaultProps = {
24
  className: ``,
25
  hasTable: false,
26
  titleIcon: ``,
27
}
28
29
export default Card
30